<div class="layui-fluid">   
    <div class="layui-card">
    
            <div  style="font-weight:700;">
               <h2 style=" text-align: center;padding-top: 8px;"> 注塑车间生产日报表</h2>  <h3 style=" float:right;padding-right: 100px;padding-bottom: 8px;">日期： {$date}</h2>
            </div>
     
        <div class="layui-card-body" >
            <table lay-filter="statistics" id="statistics"> </table>
        </div>
        
    </div>
</div>
<!--JS部分-->
<script type="text/javascript">
    layui.config({
base: '/static/layui/'
}).extend({
tableMerge: 'tableMerge'
});
layui.use(['table','element','tableMerge'], function(){
    var table = layui.table,tableMerge = layui.tableMerge;

    var app_root = layui.cache.maps +'zhusu.reportforms/';
    var layer=layui.layer,table=layui.table,form=layui.form,admin=layui.admin;
    /*数据表渲染*/
   
    table.render({
        elem: '#statistics',
        toolbar: '#toolbarDemo' ,
        title: '注塑车间生产日报表',
        cols: [[
            {type:'checkbox',fixed:'left'},
            {field:'number', merge: ['number'],edit:'text',width:70,align:'center',title:'机台编号'},
            {field:'order_id',edit:'text',width:200,align:'center',title:'合同号'},
            {field:'product_id',edit:'text',minWidth:200,align:'center',title:'半成品名称'},
            {field:'accumulate_number',edit:'text',width:100,align:'center',title:'合格累计数量'},
            {field:'scrapped_part',edit:'text',width:100,align:'center',title:'残品数量'},
            {field:'working_hours',edit:'text',width:120,align:'center',title:'实际生产工时'},      
            {field:'debugging_time',edit:'text',width:100,align:'center',title:'换模调试时间'},
            {field:'change_material_time',edit:'text',width:100,align:'center',title:'换料烘料时间'},
            {field:'abnormal_time',edit:'text',width:100,align:'center',title:'其他异常事件'},
            {field:'mo_shu',edit:'text',width:110,align:'center',title:'模数'},
        ]],
        done: function(){tableMerge.render(this)},
        url: app_root+"dailyreport?do=json",
        page: true,
        limit:{$limit}
    });/**/

    /*快编监听*/
    table.on('edit(statistics)',function(obj){
        admin.req(app_root+"edit?do=up",{id:obj.data.id,av:obj.value,af:obj.field},function(res){
            layer.msg(res.msg,{shade:[0.4,'#000'],time:1500},function(){
                if(res.code==1) table.reloadData('zhusu');
            });
        },'post',{headersToken:true});
        
    });/**/
   
  

});
</script>